package CommonOperationsClientServer;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;

public class OperationsRefactor {

    public static void closeWriteFile(FileWriter fw, PrintWriter pw) {
        try {
            pw.close();
        } catch (Exception e) {
        }
        try {
            fw.close();
        } catch (Exception e) {
        }
    }

    public static void closeReadFile(FileReader fr, BufferedReader br) {
        try {
            br.close();
        } catch (Exception e) {
        }
        try {
            fr.close();
        } catch (Exception e) {
        }
    }

    public static void outputMessage(PrintWriter output, String message) {
        output.println(message);
        output.flush();
    }
}
